package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.user.VipServiceConfig;
import com.atguigu.tingshu.user.client.impl.UserInfoDegradeFeignClient;
import com.atguigu.tingshu.vo.user.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
@FeignClient(value = "service-user",contextId = "userInfoFeignClient", fallback = UserInfoDegradeFeignClient.class)
public interface UserInfoFeignClient {

    @GetMapping(value = "/api/rpc/userinfo/getUserInfo/{userId}")
    Result<UserInfoVo> getUserInfo(@PathVariable(value = "userId") Long userId);

    @GetMapping(value = "/api/rpc/userinfo/getUserPaidAlbumTrackList/{userId}/{albumId}")
    Result<Map<Long, String>> getUserPaidAlbumTrackList(@PathVariable(value = "userId") Long userId,
                                                        @PathVariable(value = "albumId") Long albumId);

    @GetMapping(value = "/api/rpc/userinfo/getUserPaidAlbum/{userId}/{albumId}")
    Result<Boolean> getUserPaidAlbum(@PathVariable(value = "userId") Long userId,
                                     @PathVariable(value = "albumId") Long albumId);

    @GetMapping(value = "/api/rpc/userinfo/getAllVipConfig/{itemId}")
    Result<VipServiceConfig> getAllVipConfig(@PathVariable(value = "itemId")Long itemId);

    @GetMapping(value = "/api/rpc/userinfo/updateVipExpire")
    void updateVipExpire();
}